@layout("/template/container.html",{plugins:["ztree"],js:["/js/module/system/isv/index.js"]}){

<div class="layui-body-header">
    <span class="layui-body-header-title">应用列表</span>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form toolbar">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <input type="text" class="layui-input" autocomplete="off" placeholder="appId"
                                       id="appId">
                            </div>
                            <div class="layui-inline">
                                <button id="btnSearch" class="layui-btn icon-btn"><i
                                        class="layui-icon layui-icon-search"></i>搜索
                                </button>
                            </div>
                            <div class="layui-inline">
                                <button id="btnAdd" class="layui-btn icon-btn"><i class="layui-icon">&#xe654;</i>添加
                                </button>
                            </div>
                        </div>
                    </div>
                    <table class="layui-table" id="table" lay-filter="table"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="tableBar">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="managerKey">秘钥管理</a>
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="downloadKey">导出秘钥</a>
</script>

<script type="text/html" id="statusTpl">
    <select data-id="{{d.id}}" data-appKey="{{d.appKey}}" lay-filter="statusFilter" data-value="{{d.status}}">
        <option value='2' style="background-color:rgb(245, 108, 108)"><span>禁用</span></option>
        <option value='1' style="background-color:rgb(103, 194, 58);"><span>启用</span></option>
    </select>
</script>

<script type="text/html" id="part0-template">
    {{#  layui.each(d.list, function(index, item){ }}
    <form class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">appId</label>
            <div class="layui-input-block">
                <input class="layui-input" value="{{item.appKey}})"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">秘钥格式</label>
            <div class="layui-input-block">
                {{# if(item.keyFormat===1){ }}
                <input class="layui-input" value="PKCS8(JAVA适用)"/>
                {{# } else { }}
                <input class="layui-input" value="PKCS1(非JAVA适用)"/>
                {{# } }}
            </div>
        </div>
    </form>
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">应用公私钥</li>
            <li>平台公私钥</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form model-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">应用公钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea">
                            {{item.publicKeyIsv}}
                        </textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">应用私钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea">
                            {{item.privateKeyIsv}}
                        </textarea>
                        </div>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item">
                <form class="layui-form model-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">平台公钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea">
                            {{item.publicKeyPlatform}}
                        </textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">平台私钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea">
                            {{item.privateKeyPlatform}}
                        </textarea>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    {{#  }); }}
</script>
<script type="text/html" id="part1-template">
    {{#  layui.each(d.list, function(index, item){ }}
    <div style="background-color: #fdf6ec;color: #e6a23c">
        带 ★ 的分配给开发者
    </div>
    <form class="layui-form model-form" id="dataForm">
        <div class="layui-form-item">
            <label class="layui-form-label">★ appId</label>
            <div class="layui-input-block">
                <input class="layui-input" value="{{item.appKey}})" name="appKey"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密钥格式</label>
            <div class="layui-input-block">
                {{# if(item.keyFormat===1){ }}
                <input type="radio" name="keyFormat" value="1" title="PKCS8(JAVA适用)" lay-filter="keyFormat" checked>
                <input type="radio" name="keyFormat" value="2" title="PKCS1(非JAVA适用)" lay-filter="keyFormat">
                {{# } else { }}
                <input type="radio" name="keyFormat" value="1" title="PKCS8(JAVA适用)" lay-filter="keyFormat">
                <input type="radio" name="keyFormat" value="2" title="PKCS1(非JAVA适用)" lay-filter="keyFormat" checked>
                {{# } }}

            </div>
        </div>
        <div class="layui-tab layui-tab-brief" lay-filter="demo">
            <ul class="layui-tab-title">
                <li class="layui-this">应用公私钥</li>
                <li>平台公私钥</li>
            </ul>

            <div class="layui-tab-content">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="color: #1E9FFF;cursor: pointer;"
                           onclick="reloadKey()">重新生成</label>
                </div>
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label">应用公钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea" name="publicKeyIsv" id="publicKeyIsv">
                            {{item.publicKeyIsv}}
                        </textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">★ 应用私钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea" name="privateKeyIsv" id="privateKeyIsv">
                            {{item.privateKeyIsv}}
                        </textarea>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label class="layui-form-label">平台公钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea" name="publicKeyPlatform" id="publicKeyPlatform">
                            {{item.publicKeyPlatform}}
                        </textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">平台私钥</label>
                        <div class="layui-input-block">
                        <textarea class="layui-textarea" name="privateKeyPlatform" id="privateKeyPlatform">
                            {{item.privateKeyPlatform}}
                        </textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    {{#  }); }}
</script>
@}